import 'package:flutter/material.dart';
import 'package:xsdk_flutter/xsdk/utils/data_table/bean/x_bean_sf_datagrid.dart';

// ValueGetter<T>

//等同: typedef Widget XFunctionWidget<T>(T? item);
typedef XFunctionWidget<T> = Widget Function(T? item);
typedef XFunctionDo = void Function();
//点击通知
typedef XFunctionWidgetOnClick<T> = void Function(T? item);
typedef XFunctionWidgetOnClick2<T> = void Function(T? item,Function? f); //Function,可以为上一页面的finish()方法(给当前页面调用通知关闭上一界面)
typedef XFunctionPageStateFinish = void Function(dynamic item,Function finishFunction); //Function,可以为上一页面的finish()方法(给当前页面调用通知关闭上一界面)
//结果返回通知
typedef XFunctionResultCallback<T> = void Function(T? result);
typedef XFunctionResultCallback2<T,R> = void Function(T? type,R? result);
//事件通知
typedef XFunctionEventNotify<T> = void Function(T? result);

//创建widget
typedef XFunctionListItemWidget<T> = Widget Function(T? item,int index);

//分组Listview使用
typedef XFunctionGroupItemWidget<T> = Widget Function(T? item,bool? isExpanded);

//DataTable
typedef XFunctionDataRowItem = DataRow Function(dynamic rowItem);
//Table
typedef XFunctionTableRowItem = TableRow Function(dynamic rowItem);

//SfDataGrid
typedef XFunctionSfDataGridRowItem = XSfDataGridRowData Function(dynamic item);
typedef XFunctionSfDataGridColumnItem = XSfDataGridColumn Function(dynamic item);
//cell单元点击,以columnName为准,有可能会移动列位置
typedef XFunctionSfDataGridCellOnTap = void Function(int rowIndex,String columnName,int columnIndex,);
typedef XFunctionSfDataGridCellOnDoubleTap = void Function(int rowIndex,String columnName,int columnIndex,);
typedef XFunctionSfDataGridCellOnLongTap = void Function(int rowIndex,String columnName,int columnIndex,);
typedef XFunctionSfDataGridLoadMoreData = void Function(XSfDataSource source);
typedef XFunctionSfDataGridNotifyXSfDataSource = void Function(XSfDataSource source);
typedef XFunctionSfDataGridNotifyColumnResize = void Function(String columnName,double newColumnWidth);


//蓝牙/usb扫描完成结束
typedef XFunctionNotifyScanFinish<T> = void Function(List<T> scanResult);

typedef XFunctionStatefulBuilder = Widget Function(StateSetter setState);